home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / Pdmod / modules / libraries / amarquee.m < prev    next >
Encoding:
Text File  |  2002-10-28  |  6.2 KB  |  94 lines

  1. MODULE  'exec/ports'
  2. MODULE  'exec/semaphores'
  3.  
  4. /* This library contains definitions and structures necessary to use amarquee.library. */
  5. /* Different error types that can be returned to the client in QMessages */
  6.  
  7. #define QERROR_NO_ERROR        0        /* Everything is okay */
  8. #define QERROR_UNKNOWN        -1        /* Don't know what the error was. */
  9. #define QERROR_MALFORMED_KEY  -2        /* Keystring could not be parsed or "dir" does not exist */
  10. #define QERROR_NO_SERVER_MEM  -3        /* Server did not have enough mem available to complete request */
  11. #define QERROR_NO_CONNECTION  -4        /* The connection to the server went south */
  12. #define QERROR_UNPRIVILEGED   -5        /* You're not allowed to do that! */
  13. #define QERROR_UNIMPLEMENTED  -6        /* Feature you requested does not exist yet */
  14. #define QERROR_NO_CLIENT_MEM  -7        /* Your computer didn't have enough memory available to complete an action */
  15. #define QERROR_SYS_MESSAGE    -8        /* This message is a "wall" text message from a server admin */
  16. #define QERROR_SEND_DONE      -9        /* This message is a "send done" notification from your client TCP thread (new for v47) */
  17.  
  18. /* These error types may be returned by QFreeSession() or set to the error code
  19. variable (set with the QSESSION_ERRORCODEPTR tag), after a QSession
  20. allocation attempt fails. */
  21.  
  22. #define QERROR_NO_TCP_STACK     -20     /* TCP stack wasn't running */
  23. #define QERROR_HOSTNAME_LOOKUP  -21     /* Hostname lookup of server failed */
  24. #define QERROR_ABORTED          -22     /* TCP thread got a control-C */
  25. #define QERROR_NO_SERVER        -23     /* No AMarquee server at requested host/port */
  26. #define QERROR_NO_INETD         -24     /* The program wasn't launched by inetd */
  27. #define QERROR_ACCESS_DENIED    -25     /* The server wouldn't accept our connection */
  28. #define QERROR_NO_MEMORY        -26     /* The client is out of memory */
  29. #define QERROR_NO_TCPSERVER     -27     /* No server at requested host/port */
  30.  
  31. /* Flags to use with QGo() */
  32.  
  33. #define QGOF_SYNC    (1<<0)             /* Request notification via sync packet when all has settled on the server side */
  34. #define QGOF_NOTIFY  (1<<1)             /* Request notification via QERROR_SEND_DONE message when the TCP thread has finished sending this transaction (new for v47) */
  35.  
  36. /* Flags representing special privileges; used with QRequestPrivileges(), etc */
  37.  
  38. #define QPRIV_KILLCLIENTS         (1<<0)        /* license to kill! */
  39. #define QPRIV_ADMIN               (1<<1)        /* Ability to set env vars, etc, on the server */
  40. #define QPRIV_GETSYSMESSAGES      (1<<2)        /* Ability to receive special sysadmin messages */
  41. #define QPRIV_SENDSYSMESSAGES     (1<<3)        /* Ability to send special sysadmin messages */
  42. #define QPRIV_ALL                 ( $0F)        /* all possible QPRIV_* bits */
  43.  
  44. OBJECT QSession
  45.         qMsgPort:PTR TO MsgPort     /* Wait() on this for QMessages! */
  46.  
  47. /* All events from AMarquee come in this package! */
  48.  
  49. OBJECT QMessage
  50.         Msg:Message,                /* Don't directly use the contents of qm_Msg! */
  51.         ID:LONG,                    /* Message ID # of transaction related to this opCode, or -1 if no ID is applicable. */
  52.         Status:LONG,                /* One of the QERROR_* codes defined in AMarquee headers. */
  53.         Path:PTR TO UBYTE,          /* Pathname of a node, or NULL if not applicable. */
  54.         Data:VOID,           /* Pointer to beginning of data buffer, or NULL if not applicable. */
  55.         DataLen:ULONG,              /* Length of qm_Data buffer, or 0 if not applicable. */
  56.         ActualLen:ULONG,            /* Length of the data buffer stored on the AMarquee server. */
  57.         ErrorLine:ULONG,            /* Line # of the server source code that generated the error.  Useful for debugging. */
  58.         Private:VOID,        /* Private info used by FreeQMessage() */
  59.         Private2:VOID,       /* Added for v48; more private info used by FreeQMessage() */
  60.         Session:PTR TO QSession     /* Added for v50. The session this message comes from. Necessary with shared msgports  */
  61.  
  62. OBJECT QRunInfo
  63.         Allowed:LONG,           /* The theoretical maximum number of bytes your server may allocate. */
  64.         Alloced:LONG,           /* The number of bytes currently allocated by your server. */
  65.         Avail:LONG,             /* The number of bytes that may actually be allocated by your server. */
  66.         CurrentPrivs:ULONG,     /* Bit-chord of QPRIV_* bits, showing what special privs you have. */
  67.         PossiblePrivs:ULONG     /* Bit-chord of QPRIV_* bits, showing what special privs you could get if you asked. */
  68.  
  69. OBJECT QSharedMessagePort
  70.         private:SignalSemaphore,    /* Used internally */
  71.         mp:PTR TO MsgPort           /* the message port to listen on */
  72.  
  73. /* the QRAWSESSION_PROTOCOLSTOPHOOK Hook function receive a pointer to the Hook in A0, the QSession
  74. pointer in A2 and a pointer to a QProtocolStopMarkerMessage in A1. Return the length of the buffer
  75. to send to the client. Return a length of 0 if not enough data is present. With this function
  76. it's easy to make sure that no structs or other datatypes get stripped. */
  77.  
  78. OBJECT QProtocolStopMarkerMessage
  79.         buffer:PTR TO UBYTE,
  80.         length:ULONG,
  81.         userdata:ULONG,
  82.         id:LONG
  83.  
  84. /* Tags to use with QNewSocketSession(Async) */
  85. #define QRAWSESSION_MAXBUFFERSIZE    $a0000001  /* (ULONG maxBufSize) The maximum buffer size to use (same as QSetMaxRawBufSize()) */
  86. #define QRAWSESSION_PROTOCOLSTOPHOOK  $a0000002         /* (struct Hook *stopmarkerfunc) A hook with the function which sets the stop marker for a block of data */
  87. #define QRAWSESSION_RECEIVE_EXCEEDING_DATA  $a0000003   /* (BOOL b) default TRUE. Shall the last data before the connection is broken be sent to the client even though the PROTOCOLSTOPHOOK hook specify it shouldn't ?*/
  88. #define QRAWSESSION_PROTOCOLSTOPHOOK_USERDATA  $a0000004        /* (ULONG u) The initial value of the userdata field in struct QProtocolStopMarkerMessage */
  89.  
  90. /* Tags to use with QNew*Session(Async) and QNewSocket*Session(Async) */
  91. #define QSESSION_ERRORCODEPTR        $b0000001  /* (LONG *errorCode) A pointer to the variable that will hold the error code */
  92. #define QSESSION_SHAREDMSGPORT       $b0000002  /* (struct QSharedMessagePort *mp) A shared message port created with QCreateSharedMessagePort() */
  93.  
  94.